package com.exampleconsumer;

import com.examplecommon.model.User;
import com.examplecommon.service.UserService;
import com.yurpceasy.proxy.ServiceProxy;
import com.yurpceasy.proxy.ServiceProxyFactory;

import java.util.Arrays;

public class EasyConsumerExample {
    public static void main(String[] args)
    {
//        //静态代理
//        UserService userService = new UserServiceProxy();
        // 动态代理
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("测试用户");
        User result = userService.getUser(user);
        System.out.println(result.getName());
    }
}
